|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.eclipse.vtp.framework.interactions.core.support.Widget
org.eclipse.vtp.framework.interactions.voice.vxml.EventHandler
public abstract class EventHandler
The EventHandler class is the base class for the family of
VXML elements that process events and errors that are generated during
execution of a VXML document. Each instance contains a list of actions for
the interpreter to perform if the event handler receives an event. These
actions are written to the VXML document in the order they were added. There
are two optional methods to govern whether the event is received by the event
handler instance. A conditional expression can be specified that must
evaluate to true at the time the event is generated for the event handler to
be notified of the event. Also, an event handler can declare that it only
needs to be notified if it is the nth occurrence of the event by
setting the count field. Each of these options can be employed separately or
together.
| Field Summary |
|---|
| Constructor Summary | |
|---|---|
protected |
EventHandler()
Creates a new instance of EventHandler which does not employ
a conditional expression or require a specific number of occurrences to
receive an event. |
protected |
EventHandler(int count)
Creates a new instance of EventHandler that requires a
specific number of occurrences of an event to receive it. |
protected |
EventHandler(int count,
java.lang.String condition)
Creates a new instance of EventHandler with a conditional
expression that must evaluate to true for the event handler to receive an
event. |
protected |
EventHandler(java.lang.String condition)
Creates a new instance of EventHandler with a conditional
expression that must evaluate to true for the event handler to receive an
event. |
| Method Summary | |
|---|---|
void |
addAction(Action action)
Adds the action to the list of actions to be performed by the interpreter if this event handler receives an event. |
void |
addIfClause(If ifClause)
Inserts a conditional set of actions into the list of actions to be performed by the interpreter if this event handler receives an event. |
Widget[] |
getActionsAndIfClauses()
Returns the list of actions and conditionals in this event handler. |
java.lang.String |
getCondition()
Returns the conditional expression that must evaluate to true before this event handler can receive an event. |
int |
getCount()
Returns the number of occurrences of an event that will trigger this event handler. |
void |
removeAction(Action action)
Removes the action from the list of actions to be performed by the interpreter if this event handler receives an event. |
void |
removeIfClause(If ifClause)
Removes the conditional set of actions from the list of actions to be performed by the interpreter if this event handler receives an event. |
void |
setCondition(java.lang.String condition)
Sets the conditional expression that must evaluate to true for the event handler to accept an event. |
void |
setCount(int count)
Sets the number of occurrences of the event that this event handler will accept. |
protected void |
writeActionsAndIfClauses(org.xml.sax.ContentHandler outputHandler)
Write the actions and if clauses of this handler to the specified content handler. |
protected void |
writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
Write the attribute members of this handler to the supplied set. |
| Methods inherited from class org.eclipse.vtp.framework.interactions.core.support.Widget |
|---|
toString, writeAttribute, writeChildren, writeChildren, writeWidget, writeWidget, writeWidget |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
protected EventHandler()
EventHandler which does not employ
a conditional expression or require a specific number of occurrences to
receive an event.
protected EventHandler(int count)
EventHandler that requires a
specific number of occurrences of an event to receive it. It does not
employ a conditional expression that must be evaluated before receiving an
event.
count - The number of occurrences of an event for this event handler
to receive it.
protected EventHandler(java.lang.String condition)
throws java.lang.IllegalArgumentException
EventHandler with a conditional
expression that must evaluate to true for the event handler to receive an
event. It does not require a specific number of occurrences to receive an
event.
condition - Expression that must evaluate to true for the event
handler to receive the event
java.lang.IllegalArgumentException - If the supplied condition is empty.
protected EventHandler(int count,
java.lang.String condition)
throws java.lang.IllegalArgumentException
EventHandler with a conditional
expression that must evaluate to true for the event handler to receive an
event. It also requires a specific number of occurrences of the event to
receive it.
count - The number of occurrences of an event for this event handler
to receive it.condition - Expression that must evaluate to true for the event
handler to receive the event.
java.lang.IllegalArgumentException - If the supplied condition is empty.| Method Detail |
|---|
public int getCount()
public java.lang.String getCondition()
public Widget[] getActionsAndIfClauses()
public void setCount(int count)
count - The new number of occurrences.
public void setCondition(java.lang.String condition)
throws java.lang.IllegalArgumentException
condition - The conditional expression.
java.lang.IllegalArgumentException - If the supplied condition is empty.
public void addAction(Action action)
throws java.lang.NullPointerException
action - The action to add.
java.lang.NullPointerException - If the supplied action is null.
public void removeAction(Action action)
throws java.lang.NullPointerException
action - The action to remove.
java.lang.NullPointerException - If the supplied action is null.
public void addIfClause(If ifClause)
throws java.lang.NullPointerException
ifClause - The conditional set of actions to add.
java.lang.NullPointerException - If the supplied conditional is
null.
public void removeIfClause(If ifClause)
throws java.lang.NullPointerException
ifClause - The conditional set of actions to remove.
java.lang.NullPointerException - If the supplied conditional is
null.protected void writeAttributes(org.xml.sax.helpers.AttributesImpl attributes)
attributes - The attribute set to write to.
java.lang.NullPointerException - If the supplied attribute set is
null.
protected void writeActionsAndIfClauses(org.xml.sax.ContentHandler outputHandler)
throws java.lang.NullPointerException,
org.xml.sax.SAXException
outputHandler - The content handler to write to.
java.lang.NullPointerException - If the supplied content handler is
null.
org.xml.sax.SAXException - If the writing of one of the actions or if clauses
fails.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||